﻿<div class="jumbotron">
    <h1>ASP.NET</h1>
    <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
    <p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>
<div class="row">

</div>
<button type="button" class="btn btn-primary" id="getuser">测试</button>
<div>
    <button type="button" class="btn btn-default" id="login">登录到GITEE</button>
</div>
<div>
    <button type="button" class="btn btn-default" id="getoscuser">获取账户信息</button>
</div>

<script>
    $(document).ready(function () {
        $("#getuser").click(function () {
            $.get("http://localhost:50453/api/user/login", function (data) {
                console.log(JSON.stringify(data));
            });
        });
        var url = 'https://gitee.com/oauth/authorize?client_id=df1d0922cf5d515ad2aeb286bd0ba45e79d2142e54ed2e19b7ee64318592dd1e&redirect_uri=http%3A%2F%2Flocalhost%3A50453%2Fapi%2Fuser%2Fgetcode&response_type=code'
        $("#login").click(function () {
            window.location.href = url;
        });
        $("#getoscuser").click(function () {
            $.get("https://gitee.com/api/v5/users/zengfanlin1989?access_token=255a3e611c4cd40718e22c7e20d3b0ed", function (data) {
                alert(JSON.stringify(data));
            });
        });
    });
</script>